Skip to content

Migrate from Zulu Discovery API to Azul Metadata API#1010

Open
jameswald wants to merge 7 commits into
actions:mainfrom
jameswald:azul-metadata-api
Open

Migrate from Zulu Discovery API to Azul Metadata API#1010
jameswald wants to merge 7 commits into
actions:mainfrom
jameswald:azul-metadata-api

Conversation

@jameswald

@jameswald jameswald commented May 29, 2026

Copy link
Copy Markdown

Used Claude Sonnet 4.6 to implement https://docs.azul.com/core/detailed/metadata-api-migration.html. If it's way off the mark then we can close it but if it's salvageable then please feel free to push any necessary commits on top of what is already done although I believe the changes I've made for this PR are complete.

Summary

Migrates the zulu distribution from the deprecated Zulu Discovery API (https://api.azul.com/zulu/download/community/v1.0/bundles/) to the new Azul Metadata API (https://api.azul.com/metadata/v1/zulu/packages/).

Background

The old Zulu Discovery API was returning HTTP 520 errors for a few hours, breaking all distribution: zulu workflows. Since the beginning of 2023 Azul has recommended the Metadata API and published a migration guide.

Changes

src/distributions/zulu/models.ts

Updated IZuluVersions to match the new API response shape:

  • id: numberpackage_uuid: string
  • urldownload_url
  • jdk_versionjava_version
  • zulu_versiondistro_version
  • Added latest: boolean and availability_type: string

src/distributions/zulu/installer.ts

  • New API base URL: https://api.azul.com/metadata/v1/zulu/packages/
  • Renamed query parameters: extarchive_type, bundle_typejava_package_type, javafxjavafx_bundled
  • Removed hw_bitness and abi query parameters (no longer part of the API)
  • Added availability_types=ca to restrict to free community builds
  • Pagination: the new API is paginated; added a loop that iterates through all pages until an empty page is returned
  • Simplified getArchitectureOptions(): now returns a plain string instead of {arch, hw_bitness, abi}. Architecture mapping: x64x64, x86x86, arm64/aarch64aarch64
  • Linux platform: returns linux_glibc instead of linux to exclude musl packages, which standard GitHub-hosted runners do not use
  • Fixed a typo: win_aarhc4win_aarch64

README.md

Updated the architecture-mapping note to reflect the new API's conventions (arm64aarch64).

Test fixtures and tests

  • Updated all three fixture files (zulu-releases-default.json, zulu-linux.json, zulu-windows.json) to use the new field names
  • Updated URL assertions in all three installer test files to match the new endpoint and parameter names
  • Updated getArchitectureOptions test cases to expect strings instead of objects
  • Removed the DistroArch type (no longer needed)

Related issue

Fixes #795

Check list

  • Documentation updated (README.md)
  • Tests added/updated to cover the changes

Fixes #795
Fixes #636

@jameswald jameswald marked this pull request as ready for review May 29, 2026 00:46
@jameswald jameswald requested a review from a team as a code owner May 29, 2026 00:46
Copilot AI review requested due to automatic review settings May 29, 2026 00:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Migrates the Zulu (Azul) distribution from the deprecated zulu/download/community/v1.0 API to the new metadata/v1/zulu/packages API, updating request parameters, response model fields, and architecture mapping accordingly.

Changes:

  • Switched API endpoint and renamed query parameters (e.g., extarchive_type, bundle_typejava_package_type, javafxjavafx_bundled); replaced hw_bitness/abi with a single arch value and added availability_types, page, page_size parameters.
  • Updated IZuluVersions model to use new field names (package_uuid, download_url, java_version, distro_version, latest, availability_type).
  • Updated tests and fixture data to align with the new API contract; updated README note about arch mapping.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/distributions/zulu/models.ts Updated IZuluVersions interface to new Azul Metadata API schema.
src/distributions/zulu/installer.ts Updated request URL/params, response field references, and simplified getArchitectureOptions to return a single string.
tests/distributors/zulu-installer.test.ts Updated expected URLs and arch mapping assertions for macOS.
tests/distributors/zulu-linux-installer.test.ts Updated expected URLs and arch mapping for Linux.
tests/distributors/zulu-windows-installer.test.ts Updated expected URLs and arch mapping for Windows.
tests/data/zulu-windows.json Regenerated fixture to match new API response schema.
tests/data/zulu-linux.json Regenerated fixture to match new API response schema.
tests/data/zulu-releases-default.json Regenerated fixture to match new API response schema.
README.md Updated note about Zulu architecture mapping.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +111 to +119
`archive_type=${extension}`,
`java_package_type=${bundleType}`,
`javafx_bundled=${javafx}`,
`arch=${arch}`,
`hw_bitness=${hw_bitness}`,
`release_status=${releaseStatus}`,
abi ? `abi=${abi}` : null,
features ? `features=${features}` : null
]
.filter(Boolean)
.join('&');
`availability_types=ca`,
`page=1`,
`page_size=1000`
].join('&');

@jameswald jameswald May 29, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is beyond me so here's what Claude output in response to this comment:

⏺ The live API response tells the full story. All 5 results with javafx_bundled=true have -fx- in their filenames (e.g., zulu26.30.11-ca-fx-jdk26.0.1-linux_x64.tar.gz), confirming the filter works correctly.

The Copilot comment is not a legitimate issue. Here's why:

The reviewer is applying old-API logic to the new API. In the old API (/zulu/download/community/v1.0/bundles/), you needed two separate parameters to get JavaFX bundles:

  • javafx=true
  • features=fx

In the new Metadata API (/metadata/v1/zulu/packages/), javafx_bundled is a dedicated, purpose-built boolean field that directly filters for JavaFX-bundled packages — it's not an alias for javafx; it's an entirely different parameter on a different API. The live API confirms: passing javafx_bundled=true returns only packages whose names contain -fx-.

There's no features parameter on the new Metadata API at all — it's not just that we dropped it, it doesn't exist in the new API. Adding features=fx to the new URL would likely be ignored or cause an error.

The tests were correctly updated to match the new API's behavior, not to hide a regression.

Comment thread src/distributions/zulu/installer.ts Outdated
Comment thread __tests__/data/zulu-windows.json Outdated
Comment thread README.md Outdated
@jameswald jameswald changed the title Use Azul metadata API Migrate from Zulu Discovery API to Azul Metadata API May 29, 2026
@jameswald jameswald force-pushed the azul-metadata-api branch from df4cd23 to 874ffb6 Compare May 29, 2026 11:44
@jameswald

Copy link
Copy Markdown
Author

Unintentionally implemented many of the same changes from #998 although the scope of this PR is a bit narrower.

@brunoborges brunoborges added feature request New feature or request to improve the current logic distribution JDK distribution/version/source support labels Jun 22, 2026
jameswald and others added 7 commits June 22, 2026 14:14
Fold CRaC-related work into the Zulu metadata API migration by wiring crac_supported query handling, extending Zulu package docs, and updating installer tests for jdk+crac/jre+crac behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Stop paginating on a short page to avoid an extra empty request
- Guard against undefined results (not just null)
- Cap iterations at 100 pages and warn if the limit is hit to
  prevent a runaway loop if the API misbehaves

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

distribution JDK distribution/version/source support feature request New feature or request to improve the current logic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate to new Azul metadata API (from Zulu Discovery API) Allow differentiating Zulu releases with/without CRaC

3 participants